| Conditions | 2 |
| Total Lines | 15 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 29 | |||
| 30 | @Put(':id') |
||
| 31 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
| 32 | @ApiOperation({summary: 'Update project'}) |
||
| 33 | public async index(@Param() { id }: IdDTO, @Body() projectDto: ProjectDTO) { |
||
| 34 | try { |
||
| 35 | const {name, dayDuration, customerId, invoiceUnit} = projectDto; |
||
| 36 | |||
| 37 | await this.commandBus.execute( |
||
| 38 | new UpdateProjectCommand(id, name, dayDuration, invoiceUnit, customerId) |
||
| 39 | ); |
||
| 40 | |||
| 41 | return {id}; |
||
| 42 | } catch (e) { |
||
| 43 | throw new BadRequestException(e.message); |
||
| 44 | } |
||
| 47 |